package cc.rengu.redp.bizimpl.upmp.dao;

import cc.rengu.redp.bizimpl.upmp.domain.AlipayInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * @author LiuYuLiang.LL
 */
public interface AlipayInfoMapper extends BaseMapper<AlipayInfo> {
    @Select("select alipay_no from T_B_ALIPAY_INFO where status = '01'")
    public List<String> findAllAlipayNo();

    @Select("select alipay_no from T_B_ALIPAY_INFO where alipay_no = #{alipayNo} and id != id and status = '01'")
    public List<String> findAllAlipayNo(String alipayNo, String id);

    @Select("select ap_fst_name from T_B_ALIPAY_INFO where status = '01'")
    public List<String> findAllAlipayName();

    @Select("select ap_fst_name from T_B_ALIPAY_INFO where ap_fst_name = #{alipayName} and id !=#{id} and status = '01'")
    public List<String> findAllAlipayName(String alipayName, String id);

    @Select("select * from T_B_ALIPAY_INFO where ap_fst_name != #{apFstName} and ap_sec_name != #{apSecName} and ap_thi_name !=#{apThiName}")
    public List<AlipayInfo> findName(String apFstName, String apSecName, String apThiName);

    /*@Select("select distinct apFstName from AlipayInfo where apFstName like %?1%")
    public List<String> findOne(String q);*/

    @Select("select ap_sec_name from T_B_ALIPAY_INFO where ap_sec_name like %#{apSecName}% and ap_fst_name =#{apFstName}")
    public Set<String> findAplipaySec(String apSecName, String apFstName);

    @Select("select ap_thi_name from T_B_ALIPAY_INFO where ap_thi_name like %#{apthiname}% and ap_sec_name = #{apSecName} and ap_fst_name = #{apFstName} ")
    public List<String> findAplipayThi(String apthiname, String apSecName, String apFstName);

    @Select("select alipay_no from T_B_ALIPAY_INFO where ap_fst_name = #{apFstName} and ap_sec_name = #{apSecName} and ap_thi_name = #{apthiname} ")
    public String findAlipayNo(String apFstName, String apSecName, String apthiname);

    @Select("select * from T_B_ALIPAY_INFO where alipay_no =  #{alipayNo}")
    public AlipayInfo getByUk(String alipayNo);
}
